<!DOCTYPE html>
<html>
<head lang="zh-CN">
    <meta charset="UTF-8">
    <title>Index</title>
    <script src="/javascripts/socket.io/socket.io.js"></script>
</head>
<body>
    Hello World
    <button onclick="send()">say hi</button>

    <script>
        var socket = io("http://192.168.1.65",{
            reconnectionDelay:2000
        });
        socket.on('connect', function () {
            console.info('connect netty-socket.io')
        });

        socket.on('chatevent', function (data) {
            console.info(data)
        });

        socket.on('disconnect', function () {
            console.info('disconnect netty-socket.io')
        });

        socket.on('error', function () {
            console.error('error')
        });

        function send() {
            var chatObject = {userName: 'lixuwei', message: 'hi everyone!'};
            socket.emit('chatevent', chatObject);
        }
    </script>
</body>
</html>